<?php

namespace Tbf\Bundle\UpyunBundle\Model;

class UpyunCmd
{
    protected $cmd_list = array();

    /**
     * 添加一条上传命令
     * @param string $upyun_path
     * @param string $local_path
     * @param string $file_type
     */
    public function addUploadCmd($upyun_path,$local_path,$file_type='unknow')
    {
        $this->cmd_list[] = array(
            'Cmd'=>'upload',
            'UpyunPath'=>$upyun_path,
            'LocalPath'=>$local_path,
            'FileType'=>$file_type
        );
    }
    /**
     * 添加一条下载命令
     * @param string $upyun_path
     * @param string $local_path
     * @param string $file_type
     */
    public function addDownloadCmd($upyun_path,$local_path,$file_type='unknow')
    {
        $this->cmd_list[] = array(
            'Cmd'=>'download',
            'UpyunPath'=>$upyun_path,
            'LocalPath'=>$local_path,
            'FileType'=>$file_type
        );
    }
    /**
     * 添加一条删除命令
     * @param string $upyun_path
     * @param string $file_type
     */
    public function addDeleteCmd($upyun_path,$file_type='unknow')
    {
        $this->cmd_list[] = array(
            'Cmd'=>'delete',
            'UpyunPath'=>$upyun_path,
            'FileType'=>$file_type
        );
    }
    public function getCmdList()
    {
        return $this->cmd_list;
    }
}
